home *** CD-ROM | disk | FTP | other *** search
/ Info-Mac 4 / Info_Mac IV CD-ROM (Pacific HiTech Inc.)(August 1994).iso / Development / Source / Macintosh Tracker Source / Tracker Client Folder / Core 18⁄March⁄1994 / WatchCursor.c < prev    next >
Encoding:
C/C++ Source or Header  |  1993-05-08  |  1.2 KB  |  64 lines  |  [TEXT/KAHL]

  1. /* WatchCursor.c */
  2.  
  3. #define COMPILING_WATCHCURSOR_C
  4. #include "WatchCursor.h"
  5. #include "EventLoop.h"
  6.  
  7.  
  8. #define FirstCursID (128)
  9.  
  10. static MyBoolean    CursorsLoaded = False;
  11.  
  12. static short            CursorPhase = 0;
  13.  
  14. static Cursor*        LastCursor;
  15.  
  16. Cursor                        WatchCursorTable[NumWatchCursors];
  17.  
  18. ushort                        WatchCursorIndex;
  19.  
  20. ulong                            LastWatchCursorInc;
  21.  
  22.  
  23. void        StartTimeConsumingOperation(void)
  24.     {
  25.         short            Scan;
  26.         Cursor**    Temp;
  27.  
  28.         if (!CursorsLoaded)
  29.             {
  30.                 CursorsLoaded = True;
  31.                 for (Scan = 0; Scan < NumWatchCursors; Scan += 1)
  32.                     {
  33.                         ERROR(ResLoad == 0,PRERR(ForceAbort,
  34.                             "Automatic resource loading is disabled."));
  35.                         Temp = (Cursor**)GetResource('CURS',Scan + FirstCursID);
  36.                         if (Temp == NIL)
  37.                             {
  38.                                 PRERR(ForceAbort,"Unable to load cursor resource.");
  39.                             }
  40.                         ERROR(ResErr != noErr,PRERR(ForceAbort,"Resource Error occurred."));
  41.                         WatchCursorTable[Scan] = **Temp;
  42.                     }
  43.             }
  44.         if (CursorPhase == 0)
  45.             {
  46.                 WatchCursorIndex = 0;
  47.                 LastWatchCursorInc = TickCount();
  48.             }
  49.         CursorPhase -= 1;
  50.     }
  51.  
  52.  
  53. void        EndTimeConsumingOperation(void)
  54.     {
  55.         if (CursorPhase == 0)
  56.             {
  57.                 return;
  58.             }
  59. //    if (CursorPhase == -1)
  60. //        {
  61. //        }
  62.         CursorPhase += 1;
  63.     }
  64.